﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using ASAermod.FileLayers;


namespace ASAermod
{

    [Serializable]
    public class AermetData
    {


        string _surfData;

        public string SurfData
        {
            get { return _surfData; }
            set { _surfData = value; }
        }


        string _upperAirData;

        public string UpperAirData
        {
            get { return _upperAirData; }
            set { _upperAirData = value; }
        }



        //时间段

        DateTime _startTime;

        public DateTime StartTime
        {
            get { return _startTime; }
            set { _startTime = value; }
        }


        DateTime _endTime;

        public DateTime EndTime
        {
            get { return _endTime; }
            set { _endTime = value; }
        }


        double _nwsHeiht = 6.1;


        /// <summary>
        /// 测风高度
        /// </summary>
        public double NwsHeiht
        {
            get { return _nwsHeiht; }
            set { _nwsHeiht = value; }
        }






        public void WriteStage2File(string path)
        {


            Stage2Inp stage2 = new Stage2Inp();


            stage2.SURFACEQAOUT = this._surfData;

            stage2.UPPERAIRQAOUT = this._upperAirData;



            //stage2.XDATES = this._startTime.ToString("yy/MM/dd") + " " + this._endTime.ToString("yy/MM/dd");
            //直接上面的写法竟然会因为系统的不同，而给出02-02-12的结果，把/自动替换了-


            //这里我们使用复杂的写法

            stage2.XDATES = DateTimeHelper.ToAermodString(this._startTime)+" "+DateTimeHelper.ToAermodString(this._endTime);




            stage2.WriteFiles(path);


            



 
        }

        public void WriteStage3File(string path)
        {

            Stage3Inp inp = new Stage3Inp();



            inp.XDATES = DateTimeHelper.ToAermodString(this._startTime)+" " + DateTimeHelper.ToAermodString(this._endTime);

            inp.NWS_HGT = this._nwsHeiht.ToString();

            inp.FREQ_SECT = "";

        

            inp.WriteFiles(path);


           


 
        }


    }
}
